package com.loong.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.loong.dto.OperateLogDTO;
import com.loong.mapper.OperateLogMapper;
import com.loong.result.PageBean;
import com.loong.service.OperateLogService;
import com.loong.vo.OperateLogVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class OperateLogServiceImpl implements OperateLogService {
    @Autowired
    private OperateLogMapper operateLogMapper;

    @Override
    public PageBean list(OperateLogDTO operateLogDTO) {
        PageHelper.startPage(operateLogDTO.getPage(), operateLogDTO.getPageSize());
        List<OperateLogVO> operateLogList = operateLogMapper.list();
        Page<OperateLogVO> operateLogPage = (Page<OperateLogVO>) operateLogList;
        return new PageBean(operateLogPage.getTotal(), operateLogPage.getResult());
    }
}
